package org.giorgiocalderolla.showrssx;

/**
 * @author Giorgio Calderolla
 * 
 *         This class represents a problem; it's description is used for bug
 *         reporting.
 */
public class Problem {

	String message = "", stackTrace = "";

	/**
	 * Sole constructor
	 * 
	 * @param message
	 *            a short user-friendly message describing the problem
	 * @param stackTrace
	 *            the stack trace of the exception that caused this problem
	 */
	public Problem(String message, String stackTrace) {
		this.message = message;
		this.stackTrace = stackTrace;
	}

	/**
	 * Creates a textual representation of this problem
	 */
	@Override
	public String toString() {
		return ShowRSSX.APPLICATION_NAME + " " + ShowRSSX.APPLICATION_VERSION
				+ " - problem information\n\n" + message
				+ "\n\nStack trace:\n\n" + stackTrace;
	}

	/**
	 * @return the short user-friendly message describing the problem
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * @return the stack trace of the exception that caused this problem
	 */
	public String getStackTrace() {
		return stackTrace;
	}
}
